package com.jwds.digital.bios.business.rpc.feign;

import com.jwds.digital.bios.business.core.infrastructure.dto.feign.BasicStockBinReqDTO;
import com.jwds.digital.bios.business.core.infrastructure.vo.feign.BasicStockBinRespVO;
import com.jwds.digital.bios.business.rpc.feign.fallback.BasicStockBinFallBack;
import com.jwds.tdc.framework.application.lib.BaseResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 料仓与料堆基本信息Feign
 *
 * @Author hesong
 */
@FeignClient(name = "bios-flow", path = "/basic/stock/bin", fallback = BasicStockBinFallBack.class)
public interface BasicStockBinFeign {

    /**
     * 根据id查询
     *
     * @param id 数据ID
     * @return BaseResponse
     */
    @GetMapping("/{id}")
    BaseResponse<BasicStockBinRespVO> queryById(@PathVariable("id") Long id);


    /**
     * 列表查询
     *
     * @param reqDto 查询条件
     * @return BaseResponse
     */
    @PostMapping("/all")
    BaseResponse<List<BasicStockBinRespVO>> list(@RequestBody BasicStockBinReqDTO reqDto);

    /**
     * 批量更新
     *
     * @param reqDto 更新对象集合
     * @return BaseResponse
     */
    @PutMapping("/batch")
    BaseResponse batchUpdate(@RequestBody List<BasicStockBinReqDTO> reqDto);

    /**
     * 删除对象
     *
     * @param id 数据ID
     * @return BaseResponse
     */
    @DeleteMapping("/{id}")
    BaseResponse delete(@PathVariable("id") Long id);
}
